package com.example.config;

import com.example.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
public class SchedulingConfig {
    
    @Autowired
    private MessageService messageService;

    @Scheduled(fixedRate = 1000)
    public void scheduleMessageProcessing() {
        messageService.processAndSendMessages();
    }
}
